//
//  UIView+QSFrame.m
//  test
//
//  Created by Song on 2016/11/11.
//  Copyright © 2016年 Song. All rights reserved.
//

#import "UIView+QSFrame.h"

@implementation UIView (QSFrame)
/**
 *  高
 */
- (CGFloat)qs_height
{
    return self.frame.size.height;
}

- (void)setQs_height:(CGFloat)qs_height
{
    CGRect frame = self.frame;
    frame.size.height = qs_height;
    self.frame = frame;
}

/**
 *  宽
 */
- (CGFloat)qs_width
{
    return self.frame.size.width;
}

- (void)setQs_width:(CGFloat)qs_width
{
    CGRect frame = self.frame;
    frame.size.width = qs_width;
    self.frame = frame;
}

/**
 *  左上角x值
 */
- (CGFloat)qs_x
{
    return self.frame.origin.x;
}

- (void)setQs_x:(CGFloat)qs_x
{
    CGRect frame = self.frame;
    frame.origin.x = qs_x;
    self.frame = frame;
}

/**
 *  左上角y值
 */
- (CGFloat)qs_y
{
    return self.frame.origin.y;
}

- (void)setQs_y:(CGFloat)qs_y
{
    CGRect frame = self.frame;
    frame.origin.y = qs_y;
    self.frame = frame;
}

/**
 *  中点x值
 */
- (CGFloat)qs_centerX
{
    return self.center.x;
}

- (void)setQs_centerX:(CGFloat)qs_centerX
{
    CGPoint center = self.center;
    center.x = qs_centerX;
    self.center = center;
}

/**
 *  中点y值
 */
- (CGFloat)qs_centerY
{
    return self.center.y;
}

- (void)setQs_centerY:(CGFloat)qs_centerY
{
    CGPoint center = self.center;
    center.y = qs_centerY;
    self.center = center;
}

/**
 *  size
 */
- (CGSize)qs_size
{
    return self.frame.size;
}

- (void)setQs_size:(CGSize)qs_size
{
    CGRect frame = self.frame;
    frame.size = qs_size;
    self.frame = frame;
}
@end
